package day02;

public class panduanlianxu {
	public static void main(String[] args) {
		int[] x = { 8, 9, 9, 9, 9, 8 };
		System.out.println(hasContinuousFour(x));
	}

	public static boolean hasContinuousFour(int[] k) {
		int i;
		int flag = 0;
		int length = k.length;
		for (i = 0; i < length - 3; i++) {
			if (k[i] == k[i + 1] && k[i + 1] == k[i + 2] && k[i + 2] == k[i + 3]) {
				flag = 1;
			}
		}
		if (flag == 1)
			return true;
		else
			return false;
	}
}
